#include "TestConfigManager.h"

#include "ApplicationsConfig.h"
#include "OutputConfig.h"
#include "ProcessInfo.h"

TestConfigManager::TestConfigManager(void)
{
}

TestConfigManager::~TestConfigManager(void)
{
}


void TestConfigManager::TestApplications(void) {
	config::ApplicationsConfig confApp;

	confApp.enableMonitoring();
	confApp.setAppSelectionType(config::ApplicationsConfig::AST_ONLY_SELECTED);
	confApp.clearAppList();
	confApp.addApplication(_T(".*\\\\abpa\\w*\\.exe"));
	confApp.addApplication(_T("UnitTest.exe"));

	platform::XString name;
	platform::ProcessInfo::GetCurrentProcessExeName(name);
	_tprintf(_T("Current process passes filter? %s\n"), 
		(confApp.shouldAttachToApplication(name) ? _T("True") : _T("False")));
	confApp.addApplication(_T(".*\\\\UnitTest.exe"));
	_tprintf(_T("Current process passes filter? %s\n"), 
		(confApp.shouldAttachToApplication(name) ? _T("True") : _T("False")));
	

}


void TestConfigManager::TestOutput(void) {
	config::OutputConfig conf;

	conf.setLocation(_T("C:\\Work\\Projects\\CodePlex\\abpa_out"));
	_tprintf(_T("Output file name: \"%s\"\n"), 
		conf.getProcessOutputFile(_T("abpa")).c_str());
}